package com.solution.admin.sysconfig.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.solution.admin.sysconfig.dao.WechatMsgMassSendingDao;
import com.solution.admin.sysconfig.entity.WechatMsgMassSendingEntity;
import com.solution.admin.sysconfig.service.WechatMsgMassSendingService;

import com.solution.common.dao.BaseDao;
import com.solution.common.page.PageBean;
import com.solution.common.page.PageParam;
import com.solution.common.service.impl.BaseServiceImpl;
import com.solution.common.utils.string.StringUtil;

/**
 * 微信消息群发管理service实现层
 * @author solin
 * @date 2017-11-30 14:45:04
 */
@Service
public class WechatMsgMassSendingServiceImpl extends BaseServiceImpl<WechatMsgMassSendingEntity> implements WechatMsgMassSendingService {

	/**
	 * 微信消息群发管理接口
	 */
	@Autowired
	private WechatMsgMassSendingDao wechatMsgMassSendingDao;

	protected BaseDao<WechatMsgMassSendingEntity> getDao() {
		return this.wechatMsgMassSendingDao;
	}

	/**
	 * 保存微信消息群发管理
	 * @param wechatMsgMassSendingEntity 微信消息群发管理实体
	 * @return Long 添加成功微信消息群发管理的ID
	 * @author solin
	 * @date 2017-11-30 14:45:04
	 */
	public long saveWechatMsgMassSending(WechatMsgMassSendingEntity wechatMsgMassSendingEntity) {
		return wechatMsgMassSendingDao.saveWechatMsgMassSending(wechatMsgMassSendingEntity);
	}

	/**
	 * 分页查询微信消息群发管理
	 * @param pageParam 分页参数
	 * @param paramMap 查询参数
	 * @return PageBean 分页参数和分页数据
	 * @author solin
	 * @date 2017-11-30 14:45:04
	 */
	@Override
	public PageBean listWechatMsgMassSendingPage(PageParam pageParam, Map<String, Object> paramMap) {
		return wechatMsgMassSendingDao.listWechatMsgMassSendingPage(pageParam, paramMap);
	}
	
	/**
	 * 根据ID查询用户信息
	 * @param id 用户id
	 * @return wechatMsgMassSendingEntity 用户对象
	 * @author solin
	 * @date 2017-11-30 14:45:04
	 */
	public WechatMsgMassSendingEntity getWechatMsgMassSendingById(Long id) {
		return wechatMsgMassSendingDao.getById(id.longValue());
	}

	/**
	 * 更新用户
	 * @param wechatMsgMassSendingEntity 用户实体
	 * @return Long 更新是否成功，>1代表更新成功
	 * @author solin
	 * @date 2017-11-30 14:45:04
	 */
	@Override
	public int updateWechatMsgMassSending(WechatMsgMassSendingEntity wechatMsgMassSendingEntity) {
		return wechatMsgMassSendingDao.updateWechatMsgMassSending(wechatMsgMassSendingEntity);
	}
	
	
	/**
	 * 根据条件查询微信消息群发管理
	 * @param param
	 * @return 数据列表
	 * @author solin
	 * @date 2017-11-30 14:45:04
	 */
	@Override
	public List<WechatMsgMassSendingEntity> listWechatMsgMassSending( Map<String, Object> param){
		return  wechatMsgMassSendingDao.listWechatMsgMassSending(param);
	}
	
	/**
	 * 删除微信消息群发管理
	 * @param 
	 * @return int 返回删除记录条数
	 * @author solin
	 * @date 2017-11-30 14:45:04
	 */
	public int deleteWechatMsgMassSendingById(long id){
		return  wechatMsgMassSendingDao.deleteById(id);
	}
	
}
